libxl: Make local_initiate_attach more rational
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Mon, 6 Jul 2015 10:51:38 +0000 (11:51 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 7 Jul 2015 14:49:47 +0000 (15:49 +0100)
commitb1882a424ae098d722b19086b16e64b9aeccc7ca
treeca08e7299cec3220f2b70d14908cd6ad1e4ebfc1
parent826ca36fa3be0da906a6f3ebd7229e50c9f67bee
libxl: Make local_initiate_attach more rational

There are a lot of paths through
libxl__device_disk_local_initiate_attach(), but they all really boil
down to one thing: Can we just access the file directly, or do we need
to attach it?

The requirements for direct access are fairly simple:
* Is this local (as opposed to a driver domain)?
* Is this a raw format (as opposed to cooked)?
* Does this have no scripts associated with it?

If it meets all those requirements, we can access it directly;
otherwise we need to attach it.

This fixes a bug where bootloader execution fails for disks with
hotplug scripts.

This should fix a theoretical bug when using a qdisk backend in a
driver domain. (Not tested.)

Based on a patch by Roger Pau Monne <roger.pau@citrix.com>.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c